package com.example.login;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
    EditText et;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Log.d("he","button onclick");
        String name = et.getText().toString();
        Log.d("he","edit content:" + name);
        if (name.equalsIgnoreCase("123456")) {
            Toast.makeText(MainActivity.this,"it is ok", Toast.LENGTH_SHORT).show();
        }
        else {
            Toast.makeText(MainActivity.this,"input error",Toast.LENGTH_SHORT).show();
        }
        Intent intent = new Intent(MainActivity.this,MainActivity.class);
        startActivity(intent);
    }
}
